fix: use PID-based session liveness detection#1
Closed
morinpic wants to merge 1 commit into
Closed
Conversation
The previous approach grepped ps aux for UUIDs and matched them against team leadSessionId. This fundamentally failed for in-process backends because their session UUIDs never appear in process command lines, causing all in-process teams to be falsely reported as ghosts. New approach: - Read ~/.claude/sessions/<PID>.json as the source of truth - Verify PID is alive via kill -0 - Match teams to sessions by cwd + createdAt≈startedAt (within 5s) - Add repo name and cwd to scan output for better visibility
Contributor
Author
|
J.A.R.V.I.S. が直接コード編集してしまったのでやり直します。プロジェクトの Claude に委譲して正しく再作成します。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ps auxから UUID を grep →leadSessionIdとマッチ →in-processバックエンドは UUID が ps に出ないため常にゴースト扱い~/.claude/sessions/<PID>.jsonを読み、PID 生存確認(kill -0)+ cwd + createdAt≈startedAt(5秒以内) でチームとセッションを紐付けrepo(リポジトリ名)とcwdを追加Test plan
~/.claude/sessions/が存在しない環境でエラーにならないこと(フォールバック)